package com.glsc.ngateway.common.api.common.enums;


import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Title: GatewayConstant
 * @Description: 网关常数类
 * @author: 张宁
 * @version: 1.0.0
 * @date: 2020/12/21 16:29
 */

@Component
public class GatewayConstant {


    // 定义HEADER_LEVEL 为报文第一层
    public static final String HEADER_LEVEL = "-1";

    // 定义 OA 流程 主体要素
    public static final String MAIN_LEVEL = "0";


    public static final String SUCCESS = "1";

    public static final String FAILURE = "0";


    public static final String MESSAGE_BIZ_CODE = "0007915001";
    // 定义 OA 流程 明细项要素1
    public static final String DETAIL_LEVEL_ONE = "1";


    public static final String DETAIL_LEVEL_TWO = "2";


    public static final String DETAIL_LEVEL_THREE = "3";


    public static final String DETAIL_LEVEL_FOUR = "4";

    public static final String FLAG_ONE = "1";

    public static final String FLAG_ZERO = "0";


    public static final String APPLICANT = "applicant";

    public static final String EXCEPTION = "Exception";  // 返回值为String 的异常至


    public static final String PERSON_SQL = "select id from hrmresource where workcode in ($CURRVALUE$)";


    public static final String APPLICANT_APART_NAME = "sqrbm";

    public static final String APPLICANT_APART_VALUE = "3523";


    public static final String APPLICANT_COM_NAME = "sqrgs";

    public static final String APPLICANT_COM_VALUE = "21";


    public static final String PARAMS_VERIFICATION = "PARAMS_VERIFICATION";


    // 默认科技部，部门ID
    public static final String SCIENCE_DEPART_ID = "3523";

    public static final String GY_DEPART_ID = "5022";


    public static final String DOWNLOAD_FILE = "/opt/ngateway/oaflow/download_files/";

//    public static final String DOWNLOAD_FILE = "D:\\download_files\\";


    public static final String UP_FILE = "/opt/ngateway/oaflow/uploaded_files/";
    //  public static final String UP_FILE = "D:\\uploaded_files\\";

//    public static final String DOC_WEB_URL = "http://172.16.203.200:52621/oaDownloadAppendix/";

    // 判断是否为附件标志位
    public static final String IS_DOC = "1";

    // 判断是否为搜索人员标志位
    public static final String IS_PERSON = "1";

    // 泛微 返回接口，requestid 字段
    public static final String FANWEI_REQUEST_ID = "requestid";

    // 泛微 返回接口，msg 字段
    public static final String FANWEI_MSG = "msg";

    //    // 股衍用印附件
//    public static final String DERIVATIVE_SING_TYPE ="YYFJ";

/*
    public static final String LDAP_OA =  "OU=国联证券总部,OU=国联证券";


    public static final String LDAP_OA_USR= "sAMAccountName";*/


    public static final String LDAP_OA = "OU=国联证券";

    public static final String LDAP_OA_DEPARTMENT = "distinguishedname";

    public static final String LDAP_OA_USR = "sAMAccountName";

    public static final String PREFIX_KEY_TOKEN = "gateway:ldap:user:token:";

    public static final String PREFIX_KEY_USERNAME = "gateway:ldap:user:username:";


    public static final Integer DEFAULT_TOKEN_TIME = 1;


    public static final String DEFAULT_USER_STATUS = "0"; //


    public static final String LDAP_USER_NAME = "userName";

    public static final String TOKEN_EXPIRE_TIME = "expireTime";


    public static final Integer LIST_LIMIT = 100;


    public static final String RSA_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCEms2H/y5vgTIge4/lWEQxaYtwwM7pgC0wD/2+do51u3PMUmZ3sdBcG2JhHAxrMljl8nyBaBy" +
            "Lowlw8uqGTPBI+A7QHjiI2Wx9OmzCgRKdfUIir5UG+WUzjSDEELXCsoNKtCa/XBJk7W388b4orqAOWNzXTbIE945gAidWf2UuEQIDAQAB";

    public static final String RSA_PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAISazYf/Lm+BMiB7j+VYRDFpi3DAzumALTAP/b52jnW7c8xSZnex0FwbYmEcDGs" +
            "yWOXyfIFoHIujCXDy6oZM8Ej4DtAeOIjZbH06bMKBEp19QiKvlQb5ZTONIMQQtcKyg0q0Jr9cEmTtbfzxviiuoA5Y3NdNsgT3jmACJ1Z/ZS4RAgMBAAECgYBpsSlY2GAeqA9YLKRI3M2dxM5LlKJ" +
            "XIr7hrB1Hjh+GX16w4Iyjoqq8f2cul7ieSIbq4Rez3VPDSLPhvvyHBxQNLulr1D1zDzRRj0s2qGc4lUtPtGu2uEa2luYLU4vaxQULkMaP0P4o4rxB/yJmnAJFHSkmMhBH6cFxk13ZoU7zQQJBAMJ" +
            "W1RW5RJ47nzyMrIJdgPWk8UEqnac2ukkEqG/pc4rvwqwg3zhD3ZV6jmKGbDBbZgX0YpOP4GJGN7TNci5/rU0CQQCurZjU+SncjIxYf26QkRNfWWthTct0lBBSTKyRQbPGNRlmmUAjvP58/uBrKky" +
            "p+rVN1tr2XL9IXw6yO5SI13HVAkBva2VDzTKgHcLP7j9BhuZW77g6CnrU0bXAA2GmuAu8jnXoRfh0w8QY3Wkg57zDhMNbip+xxn15GpT5nghmzGDJAkEAnLFC6ME+SQaXGwftAafyLdVD2vxzJvdv" +
            "ELSRFJhQkNuvFncgry5pR21HmTpPnSc1nka/EsKuIFiNEVsa6goBpQJAI6deyjTQioLMwqkS858SoycFZ+hbHW5tN1XRL/etqYRyxAVEkG4aVtfNrsM0b2jRgOPsKXf36Bw3mEA3Ozk64Q==" +
            "df723820";


    public static final String TOKEN = "token";


    public static final String LOGIN_CODE = "login";

    public static final String LOGIN_PORTAL_CODE = "loginPortal";

    public static final String CHECK_TOKEN = "checkToken";

    public static final String RENEW_TOKEN = "renewTokenExpire";

    public static final String KICKOUT_TOKEN = "kickOutToken";

    public static final String PORTAL_CHECK_TOKEN = "portalCheckToken";


    public static final String TOKEN_OVERDUE = "TOKEN-OVERDUE";  // 返回值为String 的异常至

    // 泛微默认返回值
    public static final Map<String, String> FANWEI_DEFAULT_MAP = new HashMap<String, String>();


    public static final Map<String, String> FLOW_STATUS_MAP = new HashMap<String, String>();


    public static final Map<String, String> SYSTEM_INFO_MAP = new HashMap<String, String>();


    public static Map<String, String> flowMetaMap = new HashMap<String, String>();

    static {
        getFlowStatusMetaMap();
    }


    public static final String APPLICANT_ENV_SQL = "select id from hrmresource where workcode='$CURRVALUE$'";


    public static void getFlowStatusMetaMap() {

        flowMetaMap.put("0", "批准");
        flowMetaMap.put("1", "批准");
        flowMetaMap.put("2", "提交");
        flowMetaMap.put("3", "退回");
        flowMetaMap.put("4", "重新打开");
        flowMetaMap.put("5", "删除");
        flowMetaMap.put("6", "激活");
        flowMetaMap.put("7", "转发");
        flowMetaMap.put("9", "批注");
        flowMetaMap.put("a", "意见征询");
        flowMetaMap.put("b", "意见征询回复");
        flowMetaMap.put("e", "强制归档");
        flowMetaMap.put("h", "转办");
        flowMetaMap.put("i", "干预");
        flowMetaMap.put("j", "转办反馈");
        flowMetaMap.put("s", "督办");
        flowMetaMap.put("t", "抄送");

        FANWEI_DEFAULT_MAP.put("requestid", "-1");
        FANWEI_DEFAULT_MAP.put("msg", "创建流程失败，未知错误");

        FLOW_STATUS_MAP.put("0", "创建");
        FLOW_STATUS_MAP.put("1", "审批");
        FLOW_STATUS_MAP.put("2", "提交");
        FLOW_STATUS_MAP.put("3", "归档");

        SYSTEM_INFO_MAP.put("ysp", "国联证券股票衍生品系统");
        SYSTEM_INFO_MAP.put("amprod", "国联证券资管产品系统");
        SYSTEM_INFO_MAP.put("glam", "国联证券资管数据平台");


        SYSTEM_INFO_MAP.put("glgateway", "国联技术服务平台");

        SYSTEM_INFO_MAP.put("glrms", "国联证券数据集市风险管理系统");

        SYSTEM_INFO_MAP.put("glscdata", "国联自营数据平台");

        SYSTEM_INFO_MAP.put("glsubsidiary", "国联子公司数据平台");

        SYSTEM_INFO_MAP.put("trmportal", "风险门户");

        SYSTEM_INFO_MAP.put("glamrisk", "资管风险管理系统");

        SYSTEM_INFO_MAP.put("glgsdata", "固收数据平台");

        SYSTEM_INFO_MAP.put("722e3e0b621eed9856f7b84a8d7e97fb", "国联证券股票衍生品系统");

    }

    public static Map<String, String> NODE_TYPE_MAP = new HashMap<String, String>();

    static {
        NODE_TYPE_MAP.put("0", "startEnvent");
        NODE_TYPE_MAP.put("1", "UserTask");
        NODE_TYPE_MAP.put("3", "endEvent");
    }
}
